package 一维数组;

import java.util.Scanner;

/*
       **案例2**：输出英文星期几
       用一个数组，保存星期一到星期天的7个英语单词，从键盘输入1-7，显示对应的单词
       {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}
        */
public class Demo2 {
    public static void main(String[] args) {
        String[] week={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入（1-7）:");
        int num=scanner.nextInt();
        if (num<1 || num>7) {
            System.out.println("输入有误");
        }else {
            System.out.println("今天星期几"+week[num-1]);
        }
    }
}
